package redis

import (
	"fmt"
	"github.com/redis/go-redis/v9"
	"user_bff/appconfig"
)

var (
	RdbClient *redis.Client
)

func InitRedis() {
	a := appconfig.AppConf.RedisConfig
	addr := fmt.Sprintf("%s:%d", a.Host, a.Port)
	RdbClient = redis.NewClient(&redis.Options{
		Addr:     addr,
		Password: a.Password, // no password set
		DB:       a.DbName,   // use default DB
	})
}
